package com.lagou.dubboconsumer;

import com.lagou.myfilter.TPRecord;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author zhangxuyuan
 * @version 1.0
 * @date 2020/12/18
 */
@Service
public class SchedulingService {


    @Scheduled(cron = "0/2 * * ? * *")
    public void printTP90()
    {
        Map<String, Long> recordTP90 = TPRecord.getRecordTP90();
        System.out.println("print tp90");
        for(Map.Entry<String,Long> entry:recordTP90.entrySet())
        {
            System.out.println("方法："+entry.getKey()+" tp90："+entry.getValue()+"ms");
        }
    }
}
